package pers.baiban.sqltoword.handler;

import pers.baiban.sqltoword.config.TableParam;
import org.apache.poi.xwpf.usermodel.XWPFTable;
import org.apache.poi.xwpf.usermodel.XWPFTableCell;
import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTTcBorders;
import pers.baiban.sqltoword.util.TableUtil;

import java.util.List;

/**
 * 表头边框辅助处理器抽象类
 *
 * @author 强子初
 * @since 2023/11/29
 */
public abstract class AbstractHeaderProcessor implements HeaderProcessor {

    protected List<XWPFTableCell> cells;
    protected List<CTTcBorders> borders;
    protected TableParam param;

    @Override
    public void init(XWPFTable table, TableParam param) {
        this.cells = TableUtil.getHeader(table);
        this.borders = getCTTcBorders(table);
        this.param = param;
    }
}